export const msToTime = (s) => {
  var ms = s % 1000;
  s = (s - ms) / 1000;
  var secs = s % 60;
  s = (s - secs) / 60;
  var mins = s % 60;
  var hrs = (s - mins) / 60;

  return (
    String(hrs).padStart(2) +
    "h" +
    String(mins).padStart(2) +
    "m" +
    String(secs).padStart(2) +
    "s"
  );
};

export const getToday = () => {
  let dateNow = new Date();
  const yy = dateNow.getFullYear();
  const MM =
    dateNow.getMonth() + 1 < 10
      ? "0" + (dateNow.getMonth() + 1)
      : dateNow.getMonth() + 1;
  const dd =
    dateNow.getDate() < 10 ? "0" + dateNow.getDate() : dateNow.getDate();
  return `${yy}-${MM}-${dd}`;
};
